//
//  litePageControl.m
//  Mingthink
//
//  Created by Mike on 2015/8/15.
//  Copyright (c) 2015年 Mingthink. All rights reserved.
//

#import "litePageControl.h"

@implementation litePageControl

/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */
- (void)setCurrentPage:(NSInteger)page {
    [super setCurrentPage:page];
    for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++) {
        UIImageView* subview = [self.subviews objectAtIndex:subviewIndex];
        
        if (subviewIndex == page) {
            CGSize size;
            size.height = 7;
            size.width = 7;
            [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y, size.width,size.height)];
            [subview setBackgroundColor:self.currentPageIndicatorTintColor];
        } else {
            CGSize size;
            size.height = 7;
            size.width = 7;
            [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y, size.width,size.height)];
            [subview setBackgroundColor:self.pageIndicatorTintColor];
        }
    }
}
@end
